Skip to content

Use poly-cool as the root finder in bezier-rs #3031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jneem
Copy link

@jneem jneem commented Aug 8, 2025

This removes symmetrical_basis, which was publicly exported, and so it's a breaking change.

The big caveat here is that poly-cool is not thoroughly tested. I plan to do that next, though, and I think any issues should be fixable without breaking semver compatibility.

@@ -13,9 +13,13 @@ homepage = "https://github.com/GraphiteEditor/Graphite/tree/master/libraries/bez
repository = "https://github.com/GraphiteEditor/Graphite/tree/master/libraries/bezier-rs"
documentation = "https://graphite.rs/libraries/bezier-rs/"

[features]
std = ["glam/std"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed this to run just the bezier-rs tests (with cargo test -p bezier-rs --features=std), because without it there were lots of undefined references to math functions.

@@ -354,7 +354,8 @@ mod tests {
assert_eq!(bezier1.project(DVec2::new(100., 100.)), 1.);

let bezier2 = Bezier::from_quadratic_coordinates(0., 0., 0., 100., 100., 100.);
assert_eq!(bezier2.project(DVec2::new(100., 0.)), 0.);
assert_eq!(bezier2.project(DVec2::new(99.99, 0.)), 0.);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change this test slightly, because the old point had two nearest points (at t=0 and t=1), and the new root-finder was flagging t=0.999999999 as the minimizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant